import QtQuick 2.2
import "./Tail"

Rectangle {

    property string itemContent: ""
    property string itemPic: ""

    signal tailItem(string content, string picpath)
    signal message_Index(int index)
    signal oncloseItem()

    function createItem(content, picpath)
    {

    }

   /* width: 800;*/ height: 50
    color: "white"
    border.color: "red"; border.width: 1

    Setting{
        id: setting
        anchors{
            right: parent.right; bottom: parent.bottom; top: parent.top
            rightMargin: 1; bottomMargin: 1; topMargin: 5
        }
    }

    TailItemBar{
        id: tailitembar
       // color: "lightblue"
        anchors{
            top: parent.top; bottom: parent.bottom; left:parent.left; right: setting.left
        }

        onOnclicktail:{
            console.log("Tail 接收到 TailItemBar 的选中的 index\t\t\t Tail");
            console.log("将 index 传到 Main中")
            message_Index(index)
        }
    }

    onTailItem: {
        console.log(qsTr("Tail从Middle处接收到"+content+"消息\n\t\t\t===========Tail"))
        console.log(qsTr("Tail 将" + content + "消息传送给TailItemBar\n\t\t\t ===================Tail"));
        tailitembar.getMessage(content, picpath)
    }
    onOncloseItem: {
        console.log("Tail接收到了来自Header的关闭当前选项卡的消息，并调用了TailItemBar的close函数进行关闭")
        tailitembar.close()
    }


}
